﻿using UnityEditor;

namespace GFTest.Editor
{
    [InitializeOnLoad]
    public static class EditorWatchDog
    {
        static EditorWatchDog()
        {
            EditorApplication.update += delegate ()
            {
                if (EditorApplication.isCompiling && EditorApplication.isPlaying)
                {
                    EditorApplication.isPlaying = false;
                    EditorUtility.DisplayDialog("提示信息", "检测到当前正在编译代码，即将停止运行游戏。", "知道了");
                }
            };
        }
    }
}
